package cn.iocoder.yudao.module.game.dal.mysql.rechargerecord;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.game.dal.dataobject.rechargerecord.RechargeRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.game.controller.admin.rechargerecord.vo.*;

/**
 * 充值记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RechargeRecordMapper extends BaseMapperX<RechargeRecordDO> {

    default PageResult<RechargeRecordDO> selectPage(RechargeRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RechargeRecordDO>()
                .likeIfPresent(RechargeRecordDO::getMemberId, String.valueOf(reqVO.getMemberId()) )
                .likeIfPresent(RechargeRecordDO::getMemberName, reqVO.getMemberName())
                .likeIfPresent(RechargeRecordDO::getSn, reqVO.getSn())
                .likeIfPresent(RechargeRecordDO::getPaySn, reqVO.getPaySn())
                .eqIfPresent(RechargeRecordDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RechargeRecordDO::getAccountingTime, reqVO.getAccountingTime())
                .betweenIfPresent(RechargeRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RechargeRecordDO::getId));
    }

}